#!/usr/bin/env python# -*- coding: utf-8 -*-# @Time    : 2023/11/12 9:59# @Author  : zhaowp1109# @File    : redis_db.py# @Description :from app.core.config import settingsimport redisdef get_redis_conn():    redis_pool=redis.ConnectionPool.from_url(url=settings.REDIS_URIL)    redis_conn=redis.Redis(connection_pool=redis_pool)    return redis_conndef get_redis():    try:        r = get_redis_conn()        yield r    finally:        r.close()